package com.jic.market.enums;

/**
 * @author yinhaijun
 * @date: 2020/3/13
 */
public enum PromotionTypeEnum {
    SINGLELY(1, "单一"),
    FULL_NUM(2,"满量"),
    FULL(3, "满额"),
    SECKILL(4, "秒杀"),
    GIFT(5, "赠送"),
    COMPLEX(6, "组合"),
    XOFFER(7, "单品X"),
    increase(8, "换购"),
    SINGLE(9, "预售"),
    GROUPON(10, "拼团"),
    Coupon(11, "优惠券"),
    RED(12, "红包"),
    LOTTERY(13, "抽奖"),
    PAYMENT_REDUCTION(14, "支付立减"),
    ;

    private Integer code;
    private String message;

    PromotionTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static PromotionTypeEnum getByCode(Integer code) {
        PromotionTypeEnum[] values = PromotionTypeEnum.values();
        for (PromotionTypeEnum value : values) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
